﻿<Window x:Class="Microsoft.Samples.CustomControls.FontChooser"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:cp="clr-namespace:Xceed.Wpf.Toolkit;assembly=Xceed.Wpf.Toolkit"
        Title="Font Chooser" 
    Width="650" Height="500"
    Background="{x:Static SystemColors.ControlBrush}" WindowStyle="ToolWindow" ResizeMode="NoResize" Name="Root">
    <Grid Margin="12">
        <Grid.RowDefinitions>
            <RowDefinition Height="4*"/>
            <RowDefinition Height="3*"/>
            <!--<RowDefinition Height="2*"/>-->
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>

        <!-- Row 0: Selection controls -->
        <Grid Grid.Column="0" Grid.Row="0">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="3*"/>
                <ColumnDefinition Width="10"/>
                <ColumnDefinition Width="1*"/>
                <ColumnDefinition Width="10"/>
                <ColumnDefinition Width="1*"/>
                <ColumnDefinition Width="1*"/>
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
            </Grid.RowDefinitions>

            <!-- Families -->
            <Label Grid.Column="0" Grid.Row="0" Content="_Font family"/>
            <DockPanel Grid.Column="0" Grid.Row="1" Grid.RowSpan="3">
                <TextBox DockPanel.Dock="Top" Name="FontFamilyTextBox"/>
                <ListBox Name="FontFamilyList"/>
            </DockPanel>

            <!-- Family Typefaces (weight, style, stretch) -->
            <Label Grid.Column="2" Grid.Row="0" Grid.ColumnSpan="3" Content="_Typeface:"/>
            <ListBox Grid.Column="2" Grid.Row="1" Grid.ColumnSpan="4" Name="TypefaceList"/>

            <!-- Font sizes -->
            <Label Grid.Column="2" Grid.Row="2" Margin="0,12,0,0" Content="_Size:"/>
            <DockPanel Grid.Column="2" Grid.Row="3">
                <TextBox DockPanel.Dock="Top" Name="SizeTextBox"/>
                <ListBox Height="60" Name="SizeList"/>
            </DockPanel>

            <!-- Text decorations -->
            <DockPanel Grid.Column="4" Grid.Row="3">
                <CheckBox DockPanel.Dock="Top" Content="Underline" Name="UnderlineCheckBox"/>
                <CheckBox DockPanel.Dock="Top" Content="Baseline" Name="BaselineCheckBox"/>
                <CheckBox DockPanel.Dock="Top" Content="Strikethrough" Name="StrikethroughCheckBox"/>
                <CheckBox Content="Overline" Name="OverlineCheckBox"/>
            </DockPanel>

            <Label Content="Color" Grid.Column="6" Grid.Row="2" Margin="0,12,0,0"/>
            <cp:ColorPicker Name="ColorPicker" Grid.Column="6" Grid.Row="3" VerticalContentAlignment="Stretch"
                            SelectedColorChanged="ColorPicker_OnSelectedColorChanged"/>
            
        </Grid>

        <DockPanel Grid.Column="0" Grid.Row="1" Margin="0,12,0,0">
            <TextBlock DockPanel.Dock="Top">Preview:</TextBlock>
            <TextBox DockPanel.Dock="Left"
                FontSize="16" AcceptsReturn="True" 
                TextAlignment="Center" 
                TextWrapping="Wrap"
                VerticalScrollBarVisibility="Auto"
                Name="PreviewTextBox"
                xml:space="preserve"
                >
The quick brown fox jumps over the lazy dog                
Эх, пиши: зять съел щи, яйцо, чан брюквы. Ждём фигу!
            </TextBox>
        </DockPanel>

        <!-- Row 3: OK and Cancel buttons -->
        <StackPanel Grid.Column="0" Grid.Row="3" Orientation="Horizontal" HorizontalAlignment="Right" Margin="0,12,0,0">
            <Button Content="OK" Width="86" IsDefault="True" Click="OnOKButtonClicked"/>
            <Button Content="Cancel" Width="86" Click="OnCancelButtonClicked"/>
        </StackPanel>

    </Grid>
</Window>
